package hu.intro.dopamine.gigme;

import hu.intro.dopamine.gigme.views.MainCanvas;
import hu.intro.dopamine.gigme.views.SplashCanvas;

import javax.microedition.lcdui.Display;

public class GigmeController {
	
	GigmeMidlet midlet;
//	LastfmApi api;
	MainCanvas main;
	
	Display display;
	
	static GigmeController instance;
	
	
	public static GigmeController getInstance(GigmeMidlet midlet) {
		if (instance==null)
			instance = new GigmeController(midlet);
		return instance;
	}
	public static GigmeController getInstance() {
		return instance;
	}
	

    private GigmeController(GigmeMidlet midlet) {
        try {
            this.midlet = midlet;
            this.display = Display.getDisplay(midlet);
//            this.api = new TwitterApi();
            this.main = new MainCanvas(this);
//            settings = Settings.getInstance(midlet);
        } catch (Exception ex) {
            ex.printStackTrace();
        }
    }
    
    
    public void showMain() {
    	this.display.setCurrent(this.main);
    }
    public void showSplash() {
        SplashCanvas splash = new SplashCanvas(this);
        display.setCurrent(splash);
    }
}
